<%@page pageEncoding="ISO-8859-1"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>

<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%
        request.setAttribute("nombrePagina", "Asociar Garantias");
%>

<f:view>

    <%@include file="/WEB-INF/jspf/header.jspf" %>
    <%@include file="/WEB-INF/jspf/breadcumbs.jspf" %>
    <%@include file="/WEB-INF/jspf/options.jspf" %>

    <rich:panel>
        <h1><h:outputText value="Asociar Garantias" /></h1>
        <h:form>
            <h:messages showDetail="true" />

           <%@include file="/WEB-INF/datosModulo/datosSolicitudCredito.jspf" %>
            <br>

            <h:panelGrid columns="2">
                <h:outputLabel value="<b>Monto Cubierto:</b> " for="txtCubierto"  escape="false" />
                <h:outputText id="txtCubierto" value="" />
            </h:panelGrid>

            <br>

            <h:outputText value="<h3>Garantias:</h3>" escape="false" />
            <t:dataTable id="tblGarantias"
                         value=""
                         var="item"
                         bgcolor="#F1F1F1" border="10" cellpadding="5"
                         cellspacing="3" first="0"
                         frame="hsides" rules="all"
                         summary="This is a JSF code to create dataTable."
                         rowClasses="TableRow1,TableRow2" columnClasses="TableColumn"
                         styleClass="TableClass" headerClass="TableHeader" footerClass="TableFooter">
                <h:column>
                    <f:facet name="header"><h:outputText value="Propietario"/></f:facet>
                    <h:outputText value="" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Descripcion"/></f:facet>
                    <h:outputText value="" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Valor Total"/></f:facet>
                    <h:outputText value="" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Monto Disponible"/></f:facet>
                    <h:outputText value="" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Monto Asignado"/></f:facet>
                    <h:outputText value="" />
                </h:column>
                <h:column>
                    <h:commandLink id="btnEditar"
                                   action="submit()"
                                   value="Editar"/>
                </h:column>
                <h:column>
                    <h:commandLink id="btnMostrar"
                                   action="submit()"
                                   value="Mostrar"/>
                </h:column>
                <h:column>
                    <h:commandLink id="btnRemover"
                                   action="submit()"
                                   value="Remover"/>
                </h:column>
            </t:dataTable>
            <h:panelGrid columns="2">
                <h:commandButton id="btnAgregarGarantia" value="Agregar Garantia" styleClass="negrita" action="#{SolicitudCreditoController.agregaGarantia}"/>
            </h:panelGrid>
            <br>
            <h:outputText value="<h3>Posibles Garantias:</h3>" escape="false" />
            <t:dataTable id="tblPosiblesGarantias"
                         value="#{SolicitudCreditoController.solicitudCredito.garantiasSolicitudCollection}"
                         var="item"
                         bgcolor="#F1F1F1" border="10" cellpadding="5"
                         cellspacing="3" first="0"
                         frame="hsides" rules="all"
                         summary="This is a JSF code to create dataTable."
                         rowClasses="TableRow1,TableRow2" columnClasses="TableColumn"
                         styleClass="TableClass" headerClass="TableHeader" footerClass="TableFooter">

                <h:column>
                    <f:facet name="header"><h:outputText value="DNI Propietario"/></f:facet>
                    <h:outputText value="#{item.dniPropietario}" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Nombre Propietario"/></f:facet>
                    <h:outputText value="#{item.nombrePropietario} #{item.apepatPropietario} #{item.apematPropietario}" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Descripcion"/></f:facet>
                    <h:outputText value="#{item.descrpcion}" />
                </h:column>
                <h:column>
                    <f:facet name="header"><h:outputText value="Valor"/></f:facet>
                    <h:outputText value="#{item.valor}" />
                </h:column>
                <h:column>
                    <h:commandLink id="btnEditar"
                                   action="submit()"
                                   value="Editar"/>
                </h:column>
                <h:column>
                    <h:commandLink id="btnMostrar"
                                   action="submit()"
                                   value="Mostrar"/>
                </h:column>
                <h:column>
                    <h:commandLink id="btnRemover"
                                   action="submit()"
                                   value="Remover"/>
                </h:column>
            </t:dataTable>
            <h:panelGrid columns="2">
                <h:commandButton id="btnPosible" value="Agregar Posible Garantia" styleClass="negrita" action="#{SolicitudCreditoController.agregaPosibleGarantia}"/>
            </h:panelGrid>

            <br>
             <h:panelGrid columns="2">

                <h:commandButton id="btnRegistrar" value="Registrar" styleClass="negrita" action="#{SolicitudCreditoController.actualizarGarantias}"/>
                <h:commandButton id="btnCancelar" value="Cancelar" styleClass="negrita" action="volver"/>

            </h:panelGrid>
        </h:form>
    </rich:panel>

    <%@include file="/WEB-INF/jspf/footer.jspf" %>
</f:view>